{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "315b21a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import math\n",
    "from sympy import *\n",
    "from scipy import fftpack,signal\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a40014c9",
   "metadata": {},
   "outputs": [],
   "source": [
    "n = np.arange(16)\n",
    "x = np.cos(np.pi / 4 * n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6257becf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n均方根值 反映的是有效值而不是平均值\\n'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_rms(records):\n",
    "    return math.sqrt(np.sum(np.power(records, 2)) / len(records))\n",
    "\"\"\"\n",
    "均方根值 反映的是有效值而不是平均值\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "77645cde",
   "metadata": {},
   "outputs": [],
   "source": [
    "def rect_square_wave(origin=0, size=10, ratio=0.25, x_unit=0.1, y0=0, y1=1):\n",
    "    d = []\n",
    "    for  start in np.arange(origin-0.0125, origin + x_unit * size, x_unit):\n",
    "        d.append((start, y0))\n",
    "        middle = start + x_unit * ratio\n",
    "        d.append((middle, y0))\n",
    "        d.append((middle, y1))\n",
    "        end = start + x_unit\n",
    "        d.append((end, y1))\n",
    "\n",
    "    return d\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "414c294a",
   "metadata": {},
   "outputs": [],
   "source": [
    "rmsval = get_rms(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "07b9aafc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-2.5, 2.5)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {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c3ipyRdJ+nYHI/fLOnzkizpekmPL3TMQX5H/+OSTkTEVyPiZUl/I2n7jG22S/rLzu1PS3qrbQ8wU1MWnEVEPBoRL3XuHpa0esgZh6Wb80KS/kjSByX93zDDDVk3s/h1SR+OiP+VpIh4YcgZh6WbWYSkqzq3Xyfp9BDzDU1EHJL0zXk22S7p49F2WNKo7VXzHXOQRT8m6b+m3T/Z+dys20TEBUkvSvqBAWZqSjezmO5Otf/GzmjBWXR+FF0TEZ8bZrAGdHNevFnSm23/k+3DtrcOLd1wdTOLD0i6zfZJSQ9L+q3hRCtOr33S2H+BgDnYvk3ShKSfbjpLE2xfIelDkm5vOEoplqp9+eZn1P4p75DtjRFxtslQDblV0sci4o9tb5b0V7avjYhXmg5WukF+R39K0ppp91d3PjfrNraXqv3j2DcGmKkp3cxCtm+UdK+kbRHx3SFlG7aFZrFc0rWS/sH219S+Bnkg6Quy3ZwXJyUdiIjzEfEfkv5N7eLPpptZ3Cnpk5IUEY9J+j61/8Ozy01XfTLdIIv+CUnrbL/R9jK1X2w9MGObA5Le1bn9dklfjM6rDcksOAvbmyTdp3bJZ70OKy0wi4h4MSJWRMR4RIyr/XrFtojo6z9zKlw3XyP71f5uXrZXqH0p56tDzDgs3cziOUlvlSTbb1G76M8MNWUZDkj6lc67b66X9GJEPD/fDgO7dBMRF2zfJemg2q+o3x8RT9v+Q0mTEXFA0kfV/vHrhNovPtwyqDxN6nIWeyW9VtKnOq9HPxcR2xoLPSBdzuKy0OUsDkq6yfYzki5K2h0R6X7q7XIWvyfpL2z/jtovzN6e8RtD2w+o/Zf7is7rEe+XNCJJEfERtV+fuFnSCUkvSbpjwWMmnBMAYBr+ZSwAJEfRA0ByFD0AJEfRA0ByFD0AJEfRA0ByFD0AJPf/uY7riNGQJ8oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "t = np.linspace(0, 1, 100, endpoint=False)\n",
    "x = 2 * signal.square(2 * np.pi * 10 * t)\n",
    "fig = plt.figure()\n",
    "ax1 = fig.add_subplot(111)\n",
    "ax1.stem(t, x, markerfmt='o')\n",
    "plt.xlim(0, 1)\n",
    "plt.ylim(-2.5, 2.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "59392ce9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOn0lEQVR4nO3dYYhld33G8e9j1lSKiZbuCGF346Z0Iw5p0TAkEaGmaMsmL3ZfaDVbUqukbmsbKU0QUixR4isrtSDd1qxUrILG1Rc64Mq+sJGAZEMmRIO7YWVcbTJrIKNNk9IQk7S/vrg3mes4m3t25s7ck/1/PzBwzzn/OffZP7PPnDnn3ntSVUiSzn+vmHYASdLWsPAlqREWviQ1wsKXpEZY+JLUiG3TeuLt27fX7t27p/X0kvSy9MADD/ysqmbW871TK/zdu3ezsLAwraeXpJelJP+x3u/1lI4kNcLCl6RGWPiS1AgLX5IaYeFLUiPGFn6SzyV5PMkPzrI9ST6dZDHJQ0munHxMSdJGdTnC/zyw9yW2XwfsGX4dBP5l47EkSZM29nX4VXVPkt0vMWQ/8IUafM7y8SSvTXJJVT32Uvs9vfw/vOfOe1d28qYd/PHVl3aMfe6+dN8jfON7Z8aO60OOPmToS44+ZOhLjj5k6EuOPmToU46uJnEOfwfw6Mjy0nDdr0hyMMlCkoXnnnvuxfUnH3tqov+otXzje2c4+dhTLzmmDzn6kKEvOfqQoS85+pChLzn6kKFPOc7Flr7TtqoOA4cB5ubm6it//haAXzrS30yzl1zMC8+5lj7k6EOGvuToQ4a+5OhDhr7k6EOGaeY48h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RGWPiS1AgLX5IaYeFLUiMsfElqxP8DmUeyX9xIqPMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "d = np.array(rect_square_wave(origin=0, size=10, ratio=0.25, x_unit=0.1, y0=1, y1=0))\n",
    "figure = plt.figure()\n",
    "plt.plot(d[:, 0], d[:, 1])\n",
    "plt.xlim(0, 1)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "38988410",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
